<%@page import="com.net.domain.MarkDetails"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
	<link rel="stylesheet" href="/MamNet/css/jquery.ui.all.css">
	<script src="/MamNet/js/jquery-1.7.1.js"></script>
	<script src="/MamNet/js/ui/jquery.ui.core.js"></script>
	<script src="/MamNet/js/ui/jquery.ui.widget.js"></script>
	<script src="/MamNet/js/ui/jquery.ui.datepicker.js"></script>
	<link rel="stylesheet" href="/MamNet/css/demos.css">
	
	<script>
	$(function() {
		$( "#datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true
		});
	});
</script>

<%@ page import="com.net.domain.UserType,com.net.domain.CycleTest,com.net.domain.MarkDetails,java.util.List" %>

<form method="POST" name="student" action="/MamNet/mark/writeMarks1">
<input type="hidden" name="randomkey" value="${randomkey }" />
<input type="hidden" name="subjectId" value="${subjectId}" />
<input type="hidden" name="cycleTestId" value="${cycleTestId}" />
<input type="hidden" name="totalMarks" value="${totalMarks}" />
<input type="hidden" name="date" value="${date }" />
<table border="1">


<tr><td><b>Name</b></td><td><b>Register No</b></td><td><b>Scored Marks</b></td></tr>
<%
	// generate the radio buttons based on the entry in the database for this date
	
	List<MarkDetails> markList = (List<MarkDetails>)request.getAttribute("students");
			
			
	for(MarkDetails student :markList) {
		
		out.println("<tr><td>" + student.getStudent().getFirstName()+ "</td><td>" +student.getStudent().getRegisterNo() + "</td><td><input type='text' name= 'scored_marks_"+ student.getStudentId() +"' value=''/></td>");
		
		out.println("");	
		out.println("</tr>");
	}
			
%>

<%-- 	<c:forEach items="${students}" var="studentAttendance">
		<tr><td>${studentAttendance.student.firstName}</td>
		<td><input type="radio" name="status_${studentAttendance.studentId }" value="<% out.print(AttendanceStatus.PRESENT.getValue()); %>" checked><% out.print(AttendanceStatus.PRESENT.toString()); %></td>
		<td><input type="radio" name="status_${studentAttendance.studentId }" value="<% out.print(AttendanceStatus.ABSENT.getValue()); %>" ><% out.print(AttendanceStatus.ABSENT.toString()); %></td>
		<td><input type="radio" name="status_${studentAttendance.studentId }" value="<% out.print(AttendanceStatus.ONDUTY.getValue()); %>" ><% out.print(AttendanceStatus.ONDUTY.toString()); %></td>
		</tr>
	</c:forEach>
 --%>
</table>

	<input type="submit" value="Submit" />
	
</form>